﻿-- =========================================================================================================
-- Author:		MICHAEL RITACCO
-- Copyright:	2010 MEKHANO GROUP LLC
-- Version:		08/21/2010 1.0
-- =========================================================================================================
CREATE PROCEDURE [flcr].[api_domain_dml_upd]
	@DOMAIN_ID INT = NULL OUTPUT
	,@AUDIT_MOD_USER VARCHAR(100)
	,@AUDIT_MOD_DTTM DATETIME
	,@AUDIT_MOD_DTTM_TZ INT
	,@RLS_MASK VARBINARY(256)
	,@RLS_OWNER UNIQUEIDENTIFIER
	,@WRKFL_ITEM_ID INT
	,@WRKFL_STATUS_ID INT
	,@ACTIVE_FLG BIT
	,@SORT_ORDER BIT
	,@DOMAIN_NAME VARCHAR(100)
	,@DOMAIN_DESC VARCHAR(100)
	,@PARENT_ID INT
	
AS
BEGIN TRY
	UPDATE [flcr].[DOMAIN] 
	   SET [AUDIT_MOD_USER] = @AUDIT_MOD_USER
		  ,[AUDIT_MOD_DTTM] = @AUDIT_MOD_DTTM
		  ,[AUDIT_MOD_DTTM_TZ] = @AUDIT_MOD_DTTM_TZ 
		  ,[RLS_MASK] = @RLS_MASK
		  ,[RLS_OWNER] = @RLS_OWNER
		  ,[WRKFL_ITEM_ID] = @WRKFL_ITEM_ID
		  ,[WRKFL_STATUS_ID] = @WRKFL_STATUS_ID
		  ,[ACTIVE_FLG] = @ACTIVE_FLG
		  ,[SORT_ORDER] = @SORT_ORDER
		  ,[DOMAIN_NAME] = @DOMAIN_NAME
		  ,[DOMAIN_DESC]= @DOMAIN_DESC
		  ,[PARENT_ID] = @PARENT_ID
	 WHERE [DOMAIN_ID] = @DOMAIN_ID

END TRY
BEGIN CATCH
	EXEC [flcr].[utl_GetDBError];
END CATCH